// Copyright 2009 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: Jeff Stewart
//
// Responsible for generating an English human-readable report in HTML format.

#ifndef POPDIAG_UI_REPORTGEN_H__
#define POPDIAG_UI_REPORTGEN_H__

#include <QtCore/QObject>
#include <QtCore/QList>

namespace popdiag {

class Probe;

class ReportGenerator : public QObject {
  Q_OBJECT;
 public:
  // Create a report generator. The parent object will own this one.
  explicit ReportGenerator(QObject *parent);

  // Add a probe to be reported on.  This class does NOT take ownership of it.
  void AddProbe(const QString &name, Probe *p);

  // Add a blob of details about the client configuration.
  void AddConfigInfo(const QString &config) { config_log_ = config; }

  // Set the username for this report.
  void SetUsername(const QString &username) { username_ = username; }

  // Generate and return a report.
  QString GenerateReport();
 private:
  QString username_;
  QString config_log_;
  QList<QString> names_;
  QList<Probe *> probes_;
};

}  // namespace popdiag

#endif  // POPDIAG_UI_REPORTGEN_H__
